package com.master.equipment;

import java.net.InetSocketAddress;

import javax.annotation.Resource;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.socket.config.annotation.EnableWebSocket;

import com.master.equipment.netty.server.NettyServer;

/**
 * Chat MASTER 服务端启动类
 *
 * @author: Yang
 * @date: 2023/01/31
 * @version: 1.0.0
 * https://www.panday94.xyz
 * Copyright Ⓒ 2023 曜栋网络科技工作室 Limited All rights reserved.
 */
@EnableWebSocket
@SpringBootApplication
@ComponentScan(basePackages = {"com.master.equipment"})
public class EquipmentApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(EquipmentApplication.class, args);
    }

	@Resource
	private NettyServer server;


	@Override
	public void run(String... args) throws Exception {
		InetSocketAddress address = new InetSocketAddress("0.0.0.0",20001);
		server.start(address);
	}
	
}
